package com.thinkingstar.iads.projectcenter.entity.dao;

import com.thinkingstar.iads.common.serviceImpl.EntityRepositoryServiceImpl;
import com.thinkingstar.iads.datacenter.entity.DcProjectDesignCell;
import com.thinkingstar.iads.datacenter.entity.DcTemplateVersion;
import com.thinkingstar.iads.projectcenter.entity.PcProjectConstantData;
import com.thinkingstar.iads.projectcenter.entity.PcSjpsFile;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.QueryResult;
import org.nutz.dao.Sqls;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Criteria;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.sql.SqlCallback;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.*;


/**
 * @ClassName: DaoPcSjpsFile
 * @Description:设计评审文件
 * @author z
 */
@IocBean(args = {"refer:dao"})
public class DaoPcSjpsFile extends EntityRepositoryServiceImpl<PcSjpsFile>{

    public DaoPcSjpsFile(Dao dao) {
        super(dao);
    }

    public PcSjpsFile findByProjectAndFileNum(String project_id,String fileNum) {
        Criteria cri = Cnd.NEW();
        cri.where().and("project_id", "=", project_id).and("fileNum","=",fileNum);
        List<PcSjpsFile> list = dao().query(PcSjpsFile.class, cri);
        if (list.size()>0) {
            return list.get(0);
        } else {
            return null;
        }
    }
}
